<?php

namespace App\Models\Game\Common;

use App\Models\Game\Model;
use App\Models\Traits\Game\LogsActivity;
use Illuminate\Database\Eloquent\SoftDeletes;

class Dictionary extends Model
{
    use SoftDeletes, LogsActivity;

    /**
     * 数据表名称
     *
     * @var string
     */
    protected $table = 't_dict';

    /**
     * 不可批量赋值的属性
     *
     * @var array
     */
    protected $guarded = [];

    /**
     * 验证内容和参数匹配
     *
     * @param array $ids
     * @param array $params
     */
    protected function validate(array $ids, array $params)
    {
        Dictionary::find($ids)->each(function ($dictionary) use ($params) {
            sprintf($dictionary->content, ...$params);
        });
    }
}
